#include "Colour.h"
//	The Main Function is just for testing the Funtion that will used in the GPA CALCULATION application 
void SetColour(int front,int back){
	int Front,Back;
	Front=front;
	Back=back;
	SetColourAndBackground(Front,Back);
	return;
}
void SetColourAndBackground(int ForgC,int BackC){
	WORD wColour=((BackC & 0x0F)<<4)+(ForgC & 0x0F);
	//WORD type Vary,1 bits long(8 binary bit)
	//a & 0x0F is to extend it from int(4 binary bits long valid )to WORD(8 binary bits long)
	//WinAPI SetConsoleTextAttribute receive a 8 binary-bits long WORD to set colour
	//Former 4 binary-bits represents front-colour(the colour of text in the console window)
	//Latter 4 binary-bits represents back-colour(the colour of the background of the text)
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),wColour);
	//Use WinAPI SetConsoleTextAttribute to SET the display colour
	return;	
}

